/** Colors */
$solved-banner-bgcolor: #ff0000;

html {
    overflow-y: scroll;

    &,body {
      height: 100%;
    }

    .full-height {
        height: 100vh;
        font-size: 12pt;
    }
}

body {
    font-weight:400;
}

table, .table {
    font-size: 12pt;
}

.left-sidebar {
    position: relative;

    .left-sidebar-background {
        /* This is so hacky but necessary. */
        position: absolute;
        z-index: -1;
        width: 100%;
        margin-left: -15px;
        min-height: 99999px;
        margin-bottom: -99999px;
        overflow: hidden;
    }
}

.btn-delete {
    display: inline;
    float: right;
    margin-top: -39px;
}

.list-group {
    margin-top: 20px;
}

.right {
    float: right;
}

.panel-heading {
    & .right {
        margin-top: -2em;
    }

    & .btn {
        font-size: 150%;
    }
}

.challenge .solved {
    padding-top: 8px;
    padding-bottom: 8px;
    margin-top: 10px;
    margin-bottom: 0;
    display: inline-block;
}

.challenge-table {
    font-size: 16px;

    & .btn {
        padding-top: 0;
        padding-bottom: 0;
        margin-right: 10px;
    }

    & .btn.btn-xs {
        margin-right: 0px;
    }
}

#scoreboard {
    font-size: 16px;
}

a.btn {
    text-decoration: none;
}

.lockbtn {
    width: 95px;
}

.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.close-button{
    padding: 0px 10px;
}

.btn-sm {
    .btn-inner {
        font-size:16px;
    }
    margin: auto;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.well {
    h4 {
        margin-top: 0;
    }

    .no-decoration {
        font-size: 24px;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }

    .hash-link {
        text-align: center;
        margin-bottom: 16px;
    }
}

#news-box {
    min-height: 150px;
    overflow: auto;
    bottom: 0px;

    & ul {
        list-style-type: none;
        padding: 10px 16px;
    }

    & .news-item {
        padding-bottom: 16px;
    }

    & .news-item p {
        margin: 0;
    }

    & .news-item .byline {
        font-size: 80%;
    }
}

#countdown {
    float: right;
    /* Wish this didn't need to be hard coded. */
    line-height: 21px;
    padding-top: 9.5px;
}

#loading-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0.4;
    z-index: 2000;
    display: none;
}

/* Scoreboard chart formatting */
.sbchart {
    width: 100%;
    height: 300px;
}

.sbchart-legend {
    overflow: hidden;
    position: absolute;
    right: 0;
    max-width: 180px;
}

ul {
    &.step-legend {
        list-style-type: none;
    }

    &.step-legend li {
        white-space: nowrap;
    }
}

.step-legend-marker {
    width: 1em;
    height: 1em;
    display: inline-block;
    margin-right: 3px;
}

/* Team page */
.team-solved {
    margin-top: 20px;
}

table.team-challenges,
table.team-players,
table.team-challenges-unsolved {
    font-size: 100%;
}

.tag-chart {
    height: 250px;
}

.team-score-chart {
    height: 250px;
}

/* Helpers */
.oneline {
    white-space: nowrap;
}

/* Jeopardy grid */
$chall-border-radius: 6px;

.jeopardy-container {
    display: flex;
    width: 100%;

    &.jeopardy-tags-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    &.row {
        margin: 0;

        .jeopardy-col {
            flex-grow: 1;
        }

        .jeopardy-box {
            height: 120px;
            text-align: center;
            margin: 10px 5px;
            position: relative;
            display: inline-block;
            min-width: 120px;

            & p {
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                position: absolute;
            }
        }

        .jeopardy-cat {
            font-weight: bolder;
            font-size: 1.3em;
            border-radius: $chall-border-radius;
            margin-bottom: 0px;
        }

        .jeopardy-chall {
            perspective: 1000px;
            overflow: hidden;
            border-radius: $chall-border-radius;

            .flipper {
                transition: 0.8s;
                transform-style: preserve-3d;
                position: relative;
                height: 100%;
                width: 100%;
            }

            &:hover .flipper,
            &.hover .flipper {
                transform: rotateY(180deg);
            }

            & .front,
            & .back {
                position: absolute;
                backface-visibility: hidden;
                height: 100%;
                width: 100%;
                border-radius: $chall-border-radius;
            }

            & .front {
                z-index: 2;
                transform: rotateY(0deg);
                display: flex;
                flex-direction: column;
                justify-content: space-between;

                .chall-tags {
                    display: flex;
                    justify-content: space-around;
                    align-items: flex-end;
                    width: 100%;
                    height: 30px;

                    $dummy: '.chall-dummy:first-child:last-child';

                    .chall-tag, #{$dummy} {
                        flex-grow: 1;
                        font-size: 16px;

                        &:nth-child(2), #{$dummy} {
                            border-bottom-left-radius: $chall-border-radius;
                        }

                        &:last-child, #{$dummy} {
                            border-bottom-right-radius: $chall-border-radius;
                        }

                        &:not(:last-child) {
                            border-right: 2px solid #42A5F5;
                        }

                        height: 24px
                    }

                    #{$dummy} {
                        width: 100%;
                    }
                }

                .chall-num {
                    display: flex;

                    .chall-num-val {
                        font-size: 16px;
                        padding-left: 10px;
                        padding-top: 4px;
                    }
                }

                .chall-name {
                    padding-left: 10px;
                    padding-right: 10px;
                }

                .solved-banner {
                    transform: rotate(-45deg);
                    background-color: $solved-banner-bgcolor;
                    position: absolute;
                    top: 40%;
                    bottom: 40%;
                    left: -100%;
                    right: -100%;
                }
            }

            & .back {
                transform: rotateY(180deg);
            }
        }
    }
}

@keyframes oscillate {
    from {
        left: -33px;
    }
    to {
        left: -38px;
    }
}

.tag-selector {
    $tag-height: 36px;
    $info-height: 56px;
    $info-width: 150px;

    padding-left: 5px;
    padding-right: 5px;
    padding-top: 10px;
    padding-bottom: 0px;
    font-size: 20px;

    .tag-align {
        display: flex;

        .tag-filter {
            flex-grow: 1;
            height: $tag-height;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            cursor: pointer;

            .tag-item {
                user-select: none;
                -webkit-user-select: none;
                -moz-user-select: none;
                -ms-user-select: none;
                user-select: none;
                width: 100%;
                display: inline-block;
                text-align: center;

                i {
                    vertical-align: sub;
                }
            }

            &:first-child {
                border-top-left-radius: 6px;
                border-bottom-left-radius: 6px;
            }

            &:last-child {
                border-top-right-radius: 6px;
                border-bottom-right-radius: 6px;
            }

            &:not(:last-child) {
                margin-right: 10px;
            }
        }

        .tag-either {
            background-color: #757575;
        }

        .tag-inc {
            background-color: #2E7D32;
        }

        .tag-exc {
            background-color: #c62828;
        }
    }

    .info-box {
        position: absolute;
        right: 0px;
        width: 10px;

        .info-text {
            position: relative;
            width: $info-width;
            display: inline-block;
            height: $info-height;
            top: #{- ($info-height - $tag-height) / 2};
            right: -20px;
            transition-duration: 0.8s;
            opacity: 0;
            top: -10px;

            &::before {
                position: absolute;
                content:"keyboard_arrow_left";
                font-family: 'Material Icons';
                left: -35px;
                top: -2px;
                font-size: 46px;
            }
        }

    }

    &:hover .info-text {
        right: 0px;
        opacity: 1;
    }
}

.solvers {
    max-width: 400px;
    margin: auto;

    .solve-head {
        text-align: center;
        padding-bottom: 4px;
        border-bottom: 1px solid;
    }

    .solver-container {
        display: flex;
        justify-content: space-between;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 6px;
    }

    .team-link {
        color: inherit;
        cursor: pointer;
    }

    .show-container {
        display: flex;
        justify-content: space-around;

        .show-more {
            text-align: center;
        }
    }
}

.modal {
    overflow-y: auto;
}

#attachment-table {
    .label-sized {
        height: 17px;
    }

    .button-top {
        padding-top: 28px;
    }
}

.challenge-list {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;

    .challenge-item {
        margin-left: 0px;
        margin-top: 0px;
        margin-right: 10px;
        margin-bottom: 10px;
    }
}

.user-field {
    .multiple {
        display: flex;
    }
}

.list-item {
    display: flex;
    cursor: pointer;

    .form-control {
        height:40px;
    }
}

.navbar {
  font-size: 12pt;
}

.mobile {
  display: none;
}

/** Tag table on editing page */
#tag-table {
    tbody tr {
        &:nth-child(even) {
            background-color: rgba(0, 0, 0, 0.25);
        }
        td {
            vertical-align: middle;
        }
        .btn span {
            font-size: 1.5em;
            vertical-align: middle;
        }
    }
}

@import 'scoreboard-mobile';
